home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 19.zip / BS1 part 19 / how to learn assembler.adf / CH5 / 5_5Csiren.S < prev    next >
Text File  |  1988-02-25  |  800b  |  50 lines

  1. ;** Modulatred Sound generation using Hardware-Register **   (5.5C)
  2.  
  3. ctlw = $dff096
  4. adcon = $dff09e
  5.  
  6. c0thi = $dff0a0
  7. c0tlo = c0thi+2
  8. c0tl = c0thi+4
  9. c0per = c0thi+6
  10. c0vol = c0thi+8
  11.  
  12. ;!!! when > 500KB !!!
  13. ; org $40000
  14. ; load $40000
  15. ;!!!!!!!!!!!!!!!!!!!!
  16.  
  17. run:
  18.  move.l #table,c0thi+16 ;Table beginning
  19.  move   #8,c0tl+16      ;Table length
  20.  move   #300,c0per+16   ;Sample rate
  21.  move   #40,c0vol+16    ;Volume
  22.  
  23.  move.l #table2,c0thi
  24.  move   #8,c0tl
  25.  move   #60000,c0per
  26.  move   #20,c0vol
  27.  
  28.  move   #$8010,adcon
  29.  move   #$8203,ctlw
  30.  
  31.  move   #-1,d0
  32. loop:
  33.  dbra   d0,loop
  34.  
  35. still:
  36.  move   #$10,adcon
  37.  move   #3,ctlw
  38.  rts
  39.  
  40.  data                  ; if more than 500K put in chip ram
  41. table:
  42.  dc.b -40,-70,-90,-100,-90,-70,-40,0
  43.  dc.b 40,70,90,100,90,70,40,0
  44.  
  45. table2:
  46.  dc.w 400,430,470,500,530,500,470,430
  47.  
  48.  end
  49.  
  50.